<?php

namespace app\mini\controller\v1\shop\validate;


use think\Validate;

class orderValidate extends Validate
{
    protected $rule = [
        'shop_id'      => 'require',
        'car_id'       => 'require',
        'contact'      => 'require',
        'goods_id'     => 'require',
        'mobile'       => ['require', 'length:11', 'regex:/^1[345678]{1}\d{9}$/'],
        'page'         => 'require',
        'order_status' => 'between:0,5',
        'pay_money'    => 'require',
        'order_id'     => 'require',
        'pay_type'     => 'require|between:1,2',
    ];

    protected $message = [
        'shop_id.require'       => '门店id必填',
        'car_id.require'        => '车辆未选',
        'mobile.require'        => '手机号未填',
        'mobile.length'         => '手机号格式错误',
        'mobile.regex'          => '手机号格式错误',
        'contact.require'       => '联系人未填',
        'shop_goods_id.require' => '商品未选',
        'order_status.between'  => '订单状态参数错误',
    ];

    protected $scene = [
        'index'              => ['page', 'order_status'],
        'info'               => ['order_id'],
        'applyRefund'        => ['order_id'],
    ];
}